home *** CD-ROM | disk | FTP | other *** search
/ The X-Philes (2nd Revision) / The X-Philes Number 1 (1995).iso / xphiles / coding / 80x86 / code32.lzh / EXAMPLE1.ASM < prev    next >
Assembly Source File  |  1993-01-09  |  2KB  |  65 lines

  1.  
  2. ; This program merely lists all the files in the current directory along with
  3. ; their sizes (in hex).
  4. ;
  5. ; Enable the FINDFILE, OPENFILE, and FILESIZE functions in FILE32 for this.
  6. ; Link this file with FILE32.
  7.  
  8.         .386p
  9.         jumps
  10. code32  segment para public use32
  11.         assume cs:code32, ds:code32, ss:code32
  12.  
  13. include start32.inc
  14. include file32.inc
  15.  
  16. public  _main
  17.  
  18. ;▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  19. ; DATA
  20. ;▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  21. filemask        db      '*.*',0
  22. filebuffer      db      21 dup(?), 0dh,0ah,'$'
  23.  
  24. ;▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  25. ; CODE
  26. ;▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  27.  
  28. include pdosstr.rt
  29. include putnumtm.rt
  30.  
  31. ;═════════════════════════════════════════════════════════════════════════════
  32. _main:
  33.         mov al,4eh
  34. mainloop:
  35.         mov edx,offset filebuffer       ; search for first/next file
  36.         mov edi,offset filemask
  37.         call _findfile
  38.         jc _exit
  39.  
  40.         mov edi,edx
  41.         call _openfile                  ; get size of file and put to buffer
  42.         call _filesize
  43.         call _closefile
  44.         add edx,13
  45.         mov cl,7
  46.         call _putnumtomem
  47.  
  48.         mov edx,edi                     ; filename is zero terminated, fill
  49.         mov ecx,14                      ;  in blanks.
  50.         xor al,al
  51.         repnz scasb
  52.         dec edi
  53.         mov al,' '
  54.         rep stosb
  55.  
  56.         call _putdosstr                 ; put to screen
  57.  
  58.         mov al,4fh
  59.         jmp mainloop
  60.  
  61.  
  62. code32  ends
  63.         end
  64.  
  65.